<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Name:  Students Model
*
* Author:  Ervin R. Musngi
*
*/

class Section_listing_m extends DataMapperExt
{
	var $table = 'section_listings';
    
    var $has_many = array(
                'students'   => array(
                    'class'         => 'student_m',
					'other_field'	=> 'sections',
					'join_self_as'	=> 'section_listing',
					'join_other_as'	=> 'student',
                    'join_table'    => 'student_listings'
                ),
				'school_years'	=> array (
					'class'			=> 'school_year_m',
					'other_field'	=> 'section_listings',
					'join_other_as'	=> 'school_year',
					'join_table'	=> 'section_listings'
				),
				'sections'			=> array(
					'class'			=> 'section_m',
					'other_field'	=> 'sections',
					'join_self_as'	=> 'section',
					'join_table'	=> 'section_listings'
				)
    );
	
	var $has_one = array(
		'school_levels'	=>	array(
					'class'			=> 'school_level_m',
					'other_field'	=> 'section_listings',
					'join_other_as' => 'school_level',
					'join_table'	=> 'section_listings'
		)	
	);
    
}